#ifndef _BOARD_SUPPORT_H
#define _BOARD_SUPPORT_H

#define LED_LOC				0x01

#define LED_OFF				LPC_GPIO3->DATA&=~LED_LOC
#define LED_ON			    LPC_GPIO3->DATA|=LED_LOC
#define LED_TOGGLE		    LPC_GPIO3->DATA^=LED_LOC



#define LED_LOC				0x01

#define FPGA_SLAVE_CFG_DIN_LOC		(1<<2)
#define FPGA_SLAVE_CFG_CCLK_LOC		(1<<1)
#define FPGA_SLAVE_CFG_PROG_B_LOC   (1<<9)
#define FPGA_SLAVE_CFG_INIT_B_LOC   (1<<7)
#define FPGA_SLAVE_CFG_DONE_LOC		(1<<8)

#define PROG_B_ACTIVE	LPC_GPIO1->DATA &= ~FPGA_SLAVE_CFG_PROG_B_LOC
#define PROG_B_INACTIVE	LPC_GPIO1->DATA |= FPGA_SLAVE_CFG_PROG_B_LOC

#define DIN_ACTIVE		LPC_GPIO3->DATA |= FPGA_SLAVE_CFG_DIN_LOC
#define DIN_INACTIVE	LPC_GPIO3->DATA &= ~FPGA_SLAVE_CFG_DIN_LOC

#define CCLK_ACTIVE		LPC_GPIO3->DATA |= FPGA_SLAVE_CFG_CCLK_LOC
#define CCLK_INACTIVE	LPC_GPIO3->DATA &= ~FPGA_SLAVE_CFG_CCLK_LOC

#define DONE_STATE		(LPC_GPIO1->DATA&FPGA_SLAVE_CFG_DONE_LOC)
#define INIT_B_STATE	(LPC_GPIO1->DATA&FPGA_SLAVE_CFG_INIT_B_LOC)

#define FPGA_SUSPEND_LOC		(1<<3)

#define FPGA_SUSPEND_ACTIVE		LPC_GPIO3->DATA |= FPGA_SUSPEND_LOC
#define FPGA_SUSPEND_INACTIVE		LPC_GPIO3->DATA &= ~FPGA_SUSPEND_LOC


void InitGPIO();

#endif
